package cn.huiyunche.base.service.form;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @ClassName: VehiClesInfoFrom
 * @Description: PC端单笔下单查询费用时的提交的车辆参数
 * @author: Aaron
 * @date: 2016年9月26日 下午12:50:39
 */
public class VehiClesInfoFrom {

    //车型类别id
    @NotNull(message = "车型类别id不能为空")
    @Min(value = 1, message = "id不能为小于0")
    private Long typeId;

    //车型类别
    @NotBlank(message = "车型类别不能为空")
    @Length(min = 1, max = 2, message = "车型类别长度错误")
    private String type;

    //车辆数
    @Min(value = 1, message = "车辆数不能为小于0")
    private int amount;

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        if (null == typeId) {
            this.typeId = 2L;
        } else {
            this.typeId = typeId;
        }
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    @Override
    public String toString() {
        return "VehiClesInfoFrom [typeId=" + typeId + ", type=" + type + ", amount=" + amount + "]";
    }
}
